package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 用户证件类型
 */
public enum Enum_UserIDType {
    //，；，；，
    IDCARD("IDCARD", "身份证"),
    InnerPassport("InnerPassport", "通行证"),
    CountryPassport("CountryPassport", "护照");

    private String s;
    private String title;

    Enum_UserIDType(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_UserIDType(String s) {
        this.s = s;
        this.title = Enum_HotelRoomType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_UserIDType parseCode(String code) {
        switch (code) {
            case "IDCARD":
                return IDCARD;
            case "InnerPassport":
                return InnerPassport;
            case "CountryPassport":
                return CountryPassport;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }
}
